<?php

require_once('Joob/Registry/KVP.php');

/**
 * A wrapper for the registry class, focuses on Component Directory
 * @author griever
 */
class Joob_Registry_Directory {
	
	private static $instance = null;
	
	protected $registry = null;
	
	private function __construct() {
		$this->registry = Joob_Registry_KVP::getInstance();
	}
	
	public static function getInstance() {
		if (self::$instance == null) {
			self::$instance = new Joob_Registry_Directory();
		}
		return self::$instance;
	}
	
	/**
	 * Get the associated path of the component
	 * @param string $component the component
	 * @return the associated path of the component
	 */
	public function getComponentDirectory($component)	{
		return $this->registry->get($component, 'Joob:controller:location');
	}
	
	/**
	 * Set the associated path of the component
	 * @param string $component the component
	 * @param string $path the path for the component
	 */
	public function setComponentDirectory($component, $path)	{
		$this->registry->store($component, $path, 'Joob:controller:location');
	}
}

?>